<template>
    <ul class="sorts">
        <li v-for="item in sortList" :key="item.id">
            <img :src="item.imgUrl" alt="">
            <span>{{ item.title }}</span>
        </li>
    </ul>
</template>

<script setup>
//获取父组件传递过来的数据
const { sortList } = defineProps(['sortList'])
</script>

<style scoped>
.sorts{
    width: 100%;
    background-color: white;
    font-size: 0.32rem;
    box-sizing: border-box;
    display: flex;
    flex-flow: row wrap;
}

.sorts li{
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    flex:  0 0 20%;
    padding: 0.2rem 0;
}

.sorts li img{
    width: 1.5rem;
    height: 1.5rem;
}
.sorts li span{
    margin-top: 0.15rem;
    font-size: 0.35rem;
    color: rgb(102, 102, 102);
}
</style>